package com.donger.common.security.service;

import com.donger.upms.api.entity.SysRole;
import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.List;

/**
 * @author xyx
 * @date 2019-01-13 14:21
 */

public class UserDetail extends User {

    @Getter
    private Long userId;

    @Getter
    private Long deptId;

    @Getter
    private List<SysRole> roleList;

    @Getter
    private List<String> permissionList;

    @Getter
    private Long tenantId;

    public UserDetail(Long userId, Long deptId,Long tenantId, String username, String password, List<SysRole> roleList, List<String> permissionList, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
        this.userId = userId;
        this.roleList = roleList;
        this.permissionList = permissionList;
        this.deptId = deptId;
        this.tenantId = tenantId;
    }
}
